/******************************************************************************\
*  Animeshell 1.0 Multimedia manager                                           *
*  Copyright (C) 2006-2007 Rémy Guillemette <shaikadzari@gmail.com>            *
*                                                                              *
*  This program is free software; you can redistribute it and/or modify        *
*  it under the terms of the GNU General Public License version 2 only as      *
*  published by the Free Software Foundation.                                  *
*                                                                              *
*  This program is distributed in the hope that it will be useful,             *
*  but WITHOUT ANY WARRANTY; without even the implied warranty of              *
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               *
*  GNU General Public License for more details.                                *
*                                                                              *
*  You should have received a copy of the GNU General Public License           *
*  along with this program; if not, write to the                               *
*  Free Software Foundation, Inc.,                                             *
*  59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.                   *
\******************************************************************************/

#ifndef ANIMESHELLRC_H
#define ANIMESHELLRC_H

#include <QString>
#include <QSettings>
#include <QStringList>


/*! 
    \class animeshellrc
    \brief Animeshell option and profile class.

    This class is used to load and save user profiles and options.
    
    \author Rémy Guillemette <rguillemette@b2b2c.ca>
    \version 1.0.2
*/
class animeshellrc
{
	public: 
		/*! animeshellrc()
		    \brief animeshellrc contructor
		*/
		animeshellrc(QString pProf1, QString pProf2, QString pProf3);
		
		/*! ~animeshellrc()
		    \brief animeshellrc destructor
		*/
		~animeshellrc();
		
		/*! CreateNewFolder(QString pFolder, QString pDir, bool pNewBd)
			\brief Create a new distant folder for a profile
			\param[in] pFolder The name of the folder to create
			\param[in] pDir The path of the directory
			\param[in] pNewBd True to create a clean database
			\return True if the function is successful
		*/
		bool CreateNewFolder(QString pFolder, QString pPath, bool pNewBd);
		
		/*! GetQSettings(QString pName);
			\brief Get a complete qsettings profile
			\param[in] pName The name of the profile
			\return A QStringList with a complete profile
		*/
		QStringList GetQSettings(QString pName);
		
		/*! GetQSettingsChild(QString pName, QString pChildName);
			\brief Get a qsettings child element
			\param[in] pName The name of the profile
			\param[in] pChildName The name of the child
			\return Child's value as QString
		*/
		QString GetQSettingsChild(QString pName, QString pChildName);

		/*! SetQSettingProfile(QString pName, QString pFolder, QString pFilter, QString pBrowser, 
							   QString pWebSearch, QString pEditor, QString pPlayer);
		*/
		bool SetQSettingProfile(QString pName, QString pFolder, QString pFilter, QString pBrowser, 
							    QString pWebSearch, QString pEditor, QString pPlayer);
		
		/*! getListProfile()
			\brief Get the name of each available profile
		*/
		QStringList getListProfile();
		
	private:
	
		/*! SaveAllProfileOnClose()
			\brief Save all profile before animeshell was closing
		*/
		void SaveAllProfileOnClose();
		
		QSettings *m_Settings;
		QStringList m_ListProfile;
		int m_CurrentProfile;
};
#endif
